default:libsort.a libstatic_search.a libsplaytree.a libstring_operate.a srot static_search splaytree mystring 

libsort.a: sort.c sort.h
	cc -g -w -c sort.c
	ar -r $(PROJECT_L_DIR)/libsort.a sort.o
	cp sort.h $(PROJECT_H_DIR)/

libstatic_search.a: static_search.c static_search.h
	cc -g -w -c static_search.c
	ar -r $(PROJECT_L_DIR)/libstatic_search.a static_search.o
	cp static_search.h $(PROJECT_H_DIR)/

libsplaytree.a: splaytree.c splaytree.h
	cc -g -w -c splaytree.c
	ar -r $(PROJECT_L_DIR)/libsplaytree.a splaytree.o
	cp splaytree.h $(PROJECT_H_DIR)/

libstring_operate.a: string_operate.c string_operate.h
	cc -g -w -c string_operate.c
	ar -r $(PROJECT_L_DIR)/libstring_operate.a string_operate.o
	cp string_operate.h $(PROJECT_H_DIR)/

srot: sort_test.c
	cc -g -w -o sort sort_test.c -I$(PROJECT_H_DIR) -L$(PROJECT_L_DIR) -lsort

static_search: static_search.c
	cc -g -w -o static_search static_search_test.c -I$(PROJECT_H_DIR) -L$(PROJECT_L_DIR) -lstatic_search

splaytree: splaytree_test.c
	cc -g -w -o splaytree splaytree_test.c -I$(PROJECT_H_DIR) -L$(PROJECT_L_DIR) -lsplaytree

mystring:	string_operate_test.c
	cc -g -w -o mystring string_operate_test.c -I$(PROJECT_H_DIR) -L$(PROJECT_L_DIR) -lstring_operate

clean:
	rm -f *.o sort static_search splaytree mystring $(PROJECT_L_DIR)/libsort.a $(PROJECT_L_DIR)/libstatic_search.a $(PROJECT_L_DIR)/libsplaytree.a $(PROJECT_L_DIR)/libstring_operate.a
	rm -f $(PROJECT_H_DIR)/sort.h $(PROJECT_H_DIR)/static_search.h $(PROJECT_H_DIR)/splaytree.h $(PROJECT_H_DIR)/string_operate.h
